Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dataflow: apply diff-informed filtering consistently #17648

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

cklin
Copy link
Contributor

@cklin cklin commented Oct 2, 2024

No description provided.

@cklin cklin added no-change-note-required This PR does not need a change note DataFlow Library and removed DataFlow Library labels Oct 2, 2024
@cklin cklin marked this pull request as ready for review October 2, 2024 18:40
@cklin cklin requested a review from aschackmull October 2, 2024 18:40
@cklin
Copy link
Contributor Author

cklin commented Oct 15, 2024

@aschackmull friendly ping.

Comment on lines 3523 to 3524
AlertFiltering::filterByLocation(source.getLocation()) or
AlertFiltering::filterByLocation(sink.getLocation())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will add a lot of inlined code and redo the filterByLocation that was already done in isFilteredSource/isFilteredSink. On the other hand we don't really want to expose those two predicates beyond the SourceSinkFiltering module, as they can be confused with isRelevantSource/isRelevantSink. So instead I'd suggest adding an inlined predicate to the SourceSinkFiltering module that performs this check.

      bindingset[source, sink]
      pragma[inline_late]
      predicate isRelevantSourceSinkPair(Node source, Node sink) {
        isFilteredSource(source) or
        isFilteredSink(sink)
      }

and change this like so:

Suggested change
AlertFiltering::filterByLocation(source.getLocation()) or
AlertFiltering::filterByLocation(sink.getLocation())
isRelevantSourceSinkPair(source.getNode(), sink.getNode())

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(With this change, module AlertFiltering can remain private)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the detailed advice! I updated the PR accordingly. PTAL.

@cklin cklin force-pushed the cklin/dataflow-diff-informed-filtering branch from 105887f to 1aa3eb5 Compare October 17, 2024 17:25
@cklin cklin requested a review from aschackmull October 17, 2024 18:03
Copy link
Contributor

@aschackmull aschackmull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@cklin cklin merged commit 41e8117 into main Oct 18, 2024
31 checks passed
@cklin cklin deleted the cklin/dataflow-diff-informed-filtering branch October 18, 2024 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DataFlow Library no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants